#{extends '/template/main.html' /}
<!-- Removing search and results count filter -->
<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">全部会员</h3>
    </div>
    <div class="panel-body">
        <form method="get" id="searchForm" action="/BS0007/admin/merchant/withdrawList/${pageNumber}">
            <div style="margin-bottom: 20px;width:120px;float: left;margin-right: 10px;">
                <input type="text" class="form-control datepicker" data-format="yyyy-mm-dd" name="startTime" style="width: 120px" placeholder="开始时间" value="${startTime}">
            </div>
            <div style="margin-bottom: 20px;width:120px;float: left;margin-right: 10px;">
                <input type="text" class="form-control datepicker" data-format="yyyy-mm-dd" name="endTime" style="width: 120px" placeholder="结束时间" value="${endTime}">
            </div>
            <input type="hidden" name="merId" id="merId"   value="${merId}">

        </form>
        <button class="btn btn-turquoise" id="searchBtn">开始检索</button>
        <table class="table table-bordered table-striped" id="example-2">
            <thead>
            <tr>

                <th>提现编号</th>
                <th>提现时间</th>
                <th>商户名</th>
                <th>金额</th>
                <th>提现状态</th>
            </tr>
            </thead>

            <tbody class="middle-align">

            #{paginate.list items:resultPage , as :'withdrawalsBill'}
            <tr>

                <td>${withdrawalsBill?.billCode}</td>
                <td>${withdrawalsBill?.createAt?.format('yyyy-MM-dd HH:mm')}</td>
                <td>${withdrawalsBill?.merchant?.name}</td>
                <td>${withdrawalsBill?.amount}</td>
                <td>&{'SuccessStatus.' + withdrawalsBill?.successStatus}</td>
            </tr>
            #{/paginate.list}


            </tbody>
        </table>
        <div id="layerPage" class="col-xs-12"></div>
    </div>
</div>



<!-- Imported styles on this page -->
<link rel="stylesheet" href="/public/js/datatables/dataTables.bootstrap.css">

<script src="/public/js/datatables/js/jquery.dataTables.min.js"></script>


<!-- Imported scripts on this page -->
<script src="/public/js/datatables/dataTables.bootstrap.js"></script>
<script src="/public/js/datatables/yadcf/jquery.dataTables.yadcf.js"></script>
<script src="/public/js/datatables/tabletools/dataTables.tableTools.min.js"></script>

<script type="text/javascript" src="/public/laypage/laypage.js"></script>
<script type="text/javascript">
    console.log(${userId})
    $(document).ready(function(){
        // 提示
        var msg = '${flash.get("msg")}';
        if(msg) {
            saveSuccess(msg);
        }

        // 分页
        laypage({
            cont: $('#layerPage'), //容器。值支持id名、原生dom对象，jquery对象,
            pages: '${resultPage.pageCount}', //总页数
            skin: 'yahei',
            skip: true, //是否开启跳页
            curr:'${pageNumber}',
            jump: function(e, first){ //触发分页后的回调
                if(!first){ //一定要加此判断，否则初始时会无限刷新
                    $('#pageNumber').val(e.curr);
                    $("#searchForm").attr("action", "/BS0007/admin/merchant/withdrawList/"+e.curr);
                    $('#searchForm').submit();
                }
            }
        });
        $(document).on("click", "#searchBtn", function(){
            $("#searchForm").attr("action", "/BS0007/admin/merchant/withdrawList/1");
            $('#searchForm').submit();
        })
    });

</script>


